/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ongclientejava;

import java.awt.Component;
import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

/**
 *
 * @author PAULI
 */
public class MiRender extends JLabel implements TableCellRenderer{
    
    /** Constructor por defecto.*/
     public MiRender(Icon[] iconos)
    {
        this.iconos = iconos;
     }
    
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        JLabel etiqueta = new JLabel();
        if (value instanceof Integer)
         {
             int valor = ((Integer)value).intValue();
             if (valor ==0)
                etiqueta.setIcon (iconos[0]);
             else if (valor == 1)
                 etiqueta.setIcon (iconos[1]);
             
             etiqueta.setToolTipText (Integer.toString (valor));
         }
         
         return etiqueta;

    }

    private Icon[] iconos = null;

}
